From 99f8ff2844af4b9a4d45077a2cfcc3ebb4868184 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Tue, 20 Feb 2007 12:27:03 +0000 Subject: [PATCH] linux: Fix swiotlb bug-out due to uninitialised end_pfn/max_mapnr. Signed-off-by: Keir Fraser --- linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/maddr.h | 2 +- linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/maddr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/maddr.h b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/maddr.h index 1d345898cc..8f3b7d8298 100644 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/maddr.h +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/maddr.h @@ -103,7 +103,7 @@ static inline unsigned long mfn_to_local_pfn(unsigned long mfn) static inline void set_phys_to_machine(unsigned long pfn, unsigned long mfn) { - BUG_ON(pfn >= max_mapnr); + BUG_ON(max_mapnr && pfn >= max_mapnr); if (xen_feature(XENFEAT_auto_translated_physmap)) { BUG_ON(pfn != mfn && mfn != INVALID_P2M_ENTRY); return; diff --git a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/maddr.h b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/maddr.h index 249b95965f..2bbac7cb4e 100644 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/maddr.h +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/maddr.h @@ -97,7 +97,7 @@ static inline unsigned long mfn_to_local_pfn(unsigned long mfn) static inline void set_phys_to_machine(unsigned long pfn, unsigned long mfn) { - BUG_ON(pfn >= end_pfn); + BUG_ON(end_pfn && pfn >= end_pfn); if (xen_feature(XENFEAT_auto_translated_physmap)) { BUG_ON(pfn != mfn && mfn != INVALID_P2M_ENTRY); return; -- 2.30.2